﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BotonJXC.Entity;

namespace BotonJXC.Forms.Events
{
    public delegate void ProductTypeSelectedEventHandler(object sender, ProductTypeSelectedEventArgs e);
    public class ProductTypeSelectedEventArgs : EventArgs
    {
        IList<ProductType> _selectedProductTypes = null;
        public ProductTypeSelectedEventArgs(ProductType selectedProductType)
        {
            SelectedProductTypes.Add(selectedProductType);
        }
        public ProductTypeSelectedEventArgs(IList<ProductType> selectedProductTypes)
        {
            _selectedProductTypes = selectedProductTypes;
        }
        public ProductType SelectedProductType
        {
            get
            {
                if (_selectedProductTypes != null && _selectedProductTypes.Count > 0)
                    return _selectedProductTypes[0];
                else
                    return null;
            }
        }
        public IList<ProductType> SelectedProductTypes
        {
            get
            {
                if (_selectedProductTypes == null)
                    _selectedProductTypes = new List<ProductType>();
                return _selectedProductTypes;
            }
        }
    }
}
